var myChart_pie,myChart_columnar;

$(
    function ()
    {
        var dom = document.getElementById("container");
        myChart_pie = echarts.init(dom);
        var app = {};
        option = null;
        option = {
            title : {
                text: '集中备份错误数据占比',
                subtext: '',
                x:'center'
            },
            tooltip : {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                left: 'left',
                data: ['系统数据','话单数据','用户数据','日志数据','配置备份']
            },
            series : [
                {
                    name: '访问来源',
                    type: 'pie',
                    radius : '55%',
                    center: ['50%', '60%'],
                    data:[
                        {value:0, name:'系统数据'},
                        {value:0, name:'话单数据'},
                        {value:0, name:'用户数据'},
                        {value:0, name:'日志数据'},
                        {value:0, name:'配置备份'}
                    ],
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        ;
        if (option && typeof option === "object") {
            myChart_pie.setOption(option, true);
        }

        var dom = document.getElementById("container_1");
        myChart_columnar = echarts.init(dom);
        var app = {};
        option = {
            title: {
                text: '系统数据类型'
            },
            tooltip : {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross',
                    label: {
                        backgroundColor: '#6a7985'
                    }
                }
            },
            legend: {
                data:['系统数据']
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis : [
                {
                    type : 'category',
                    boundaryGap : false,
                    data : ['周一','周二','周三','周四','周五','周六','周日']
                }
            ],
            yAxis : [
                {
                    type : 'value'
                }
            ],
            series : [
                {
                    name:'系统数据',
                    type:'line',
                    stack: '总量',
                    areaStyle: {},
                    data:[120, 132, 101, 134, 90, 230, 210]
                }
            ]
        };
        if (option && typeof option === "object") {
            myChart_columnar.setOption(option, true);
        }

    }
)

layui.use(['form',"layer"], function(){
    var form = layui.form;
    var layer=layui.layer;

    layer.open({
        type: 1
        ,title:"消息提示"
        ,offset: 'auto' //具体配置参考：http://www.layui.com/doc/modules/layer.html#offset
        ,id: 'layerDemo'+1 //防止重复弹出
        ,content: '<div style="padding: 10px">备份失败数量总数：4<br></br>设备:SCPZH-MC-CMNET-BAS01-JNEL<br> 类型：系统数据</div>'
        ,btn: '立即处理'
        ,btnAlign: 'c' //按钮居中
        ,shade: 0 //不显示遮罩
        ,yes: function(){
            layer.closeAll();
        }
    });
    //各种基于事件的操作，下面会有进一步介绍
});